/**
 * Created by Administrator on 2018-03-14.
 */
import axios from 'axios'
const host = 'http://tft-dev/api2'

// 订单管理列表页：查询所有订单
export function queryAllOrder (data) {
  const url = `${host}/order/orders`
  return axios.post(url, data).then(res => {
    return Promise.resolve(res.data)
  })
}
// 修改订单状态
export function modifyOrderStatus (data) {
  const url = `${host}/order/status`
  return axios.post(url, data).then(res => {
    return Promise.resolve(res.data)
  })
}
// 订单详情页：查询订单详情
export function queryOrderStatus (id) {
  const url = `${host}/order/order/${id}`
  return axios.post(url, {
    id: id
  }).then(res => {
    return Promise.resolve(res.data)
  })
}
// 发货单列表：根据条件查询发货单列表
export function queryDeliverList(data) {
  const url = `${host}/shipments/shipments`
  return axios.post(url, data).then(res => {
    return Promise.resolve(res.data)
  })
}
// 订单详情页：查询收件人信息
export function queryConsigneeInfo(id) {
  const url = `${host}/shipments/shipment/${id}`
  return axios.post(url, {
    id: id
  }).then(res => {
    return Promise.resolve(res.data)
  })
}
// 派件单页面：查询所有派件单
export function queryAllDelivery(data) {
  const url = `${host}/deliverySlip/deliverys`
  return axios.post(url, data).then(res => {
    return Promise.resolve(res.data)
  })
}
